package myHomework;

import java.util.Scanner;

public class Work6 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true)
        {
            int n=scanner.nextInt();
            if(n==0)
            {
                break;
            }
            int i;
            int[] charNum=new int[5];
            for(i=0;i<5;i++)
            {
                charNum[i]=n%10;
                n=n/10;
            }
            for(i=0;i<5/2;i++)
            {
                if(charNum[i]==charNum[5-i-1]){
                    continue;
                }else{
                    break;
                }
            }
            if(i==5/2)
            {
                System.out.println("n is a palindrome number");
            }else{
                System.out.println("n not is a palindrome number");
            }
        }
    }
}
